#include <cstdio>
int main()
{
    int num;
    scanf("%d",&num);
    int a1,a2,a3,a4;
    int A,B;
    A=B=0;
    int sum;
    while(num--)
    {
        scanf("%d %d %d %d",&a1,&a2,&a3,&a4);
        sum=a1+a3;
        if(a2==sum)
        {
            if(a4!=sum)++B;
        }else{
            if(a4==sum)++A;
        }
    }
    printf("%d %d\n",A,B);
    return 0;
}
